package com.server.commons.file.interfaces;

import com.server.commons.file.model.input.UpLoadImageInput;
import com.server.commons.file.model.input.UpdateFileInput;
import com.server.commons.file.model.input.UpdateImageInput;
import com.server.commons.file.model.input.UploadFileInput;
import com.server.commons.file.model.output.UpLoadImageOutput;
import com.server.commons.file.model.output.UploadFileOutput;

import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;

/**
 * 所有文件操作都走这个接口
 * @author LXC
 * @date 2022/5/7 19:30
 */
public interface FileInterface {

    //上传文件
    UploadFileOutput uploadFile(UploadFileInput uploadFileInput);

    //上传图片
    UpLoadImageOutput uploadImage(UpLoadImageInput upLoadImageBo);

    UpLoadImageOutput upLoadThumbnailImage(UpLoadImageInput upLoadImageInput, Integer scaleSize);

    //上传图片
    UpLoadImageOutput upLoadMainImage(UpLoadImageInput upLoadImageInput);

    //更新文件
    UploadFileOutput updateFile(UpdateFileInput updateFileInput);

    //更新图片
    UploadFileOutput updateImage(UpdateImageInput updateImageBo);

    //下载
    byte[] downFile(String paths);

    //删除文件
    Boolean deleteFile(String paths);

    //获取文件大小
    Long getSize(String bucketName, String paths);

    //获取临时分享URL 秒
    String getShareUrl(String paths,int duration);
}
